package org.insidesource.flexbugs.model;

import java.io.Serializable;
import java.sql.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

@Entity
public class Comment implements Serializable
{
	private static final long serialVersionUID = 1L;
	
	private Long id;
	private Issue issue;
	private String author;
	private Date createdDate;
	private String commentText;
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public Long getId()
	{
		return id;
	}
	public void setId(Long id)
	{
		this.id = id;
	}
	
	@ManyToOne(fetch=FetchType.EAGER)
//	@Column(name="issueId")
	public Issue getIssue()
	{
		return issue;
	}
	public void setIssue(Issue issue)
	{
		this.issue = issue;
	}
	
	@Column(name="author")
	public String getAuthor()
	{
		return author;
	}
	public void setAuthor(String author)
	{
		this.author = author;
	}
	
	@Column(name="createDate")
	public Date getCreatedDate()
	{
		return createdDate;
	}
	public void setCreatedDate(Date createdDate)
	{
		this.createdDate = createdDate;
	}
	
	@Column(name="commentText")
	public String getCommentText()
	{
		return commentText;
	}
	public void setCommentText(String commentText)
	{
		this.commentText = commentText;
	}
	
}
